#ifndef _RMRUTIL
#define _RMRUTIL
#include "WPILib.h"
#include "RMRIO.h"
#include "math.h"

/*
 * RMRUtil.h
 * 
 * Utility functions
 * 
 * 
 */

// Limit val to range -1 .. 1
float Limit(float val);

// Limit val to range min .. max
float Limit(float val, float min, float max);

// Linearly scale val from old_min .. old_max to new_min .. new_max
float ScaleRangeToRange(float val, float old_min, float old_max, float new_min, float new_max);

// Random int between low and high
int RandInt(int low, int high);

// Random float between low and high
float RandFloat(float low, float high);


// hypotenues of a right triangle
float Hypot(float a, float b);


/*
 * Constants
 * 
 * (specific to our programing, not the robot
 * 
 */
#define DEBUG_OUT_PERIOD 20000
#define DEBUG_OUT_PERIOD_PID 5


#define PI 3.14159265

#endif

